package com.yz.springtest.ioc;
/**
 * 导演
 * @author Administrator
 *
 */
public class Director {
	public void direct () {
		//指定演员
		GeLi geLi = new LiuDeHua(); 
		/**************构造器注入***********************/
		//注入具体饰演者到剧本
//		MoAttack moAttack = new MoAttack(geLi);
//		moAttack.cityGateAsk();  

		/**************属性注入***********************/
//		MoAttack moAttack = new MoAttack();
//		moAttack.setGeLi(geLi);
//		moAttack.cityGateAsk();
		
		/************接口注入  不采用该方式*************************/
		
		MoAttack moAttack = new MoAttack();
		moAttack.injectGeLi(geLi);
		moAttack.cityGateAsk();
	}
	
 
}
